<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        
        <link type="text/css" rel="stylesheet" href="css/style.css"/>
        <script type="text/javascript" src="js/script.js"></script>
    </head>
    <body>        
        <div id="content">     
            <h1>Cadastrar/Editar Consulta</h1>
            <div id="menu">
                <ul>
                    <li><a href="homeSecretary.jsp"> Página Inicial</a></li>
                </ul>
            </div>
            <form name="marcarConsulta" method="post" action="ConsultaServlet?page=insert">
		<div id="erro"></div>
		<fieldset>
                    <legend>Marcar Consulta</legend>
                    <table>
                        <tr>
                            <td colspan="5"> <div id="erro"></div></td>
                        </tr>
                        <tr>
                            <td colspan="5">
                                <div id="buscaPaciente">
                                    
                                    <label for="inpBuscaPaciente">Paciente:
                                        <select name="buscaPaciente" id="inpBuscaPaciente">
                                            <c:forEach items="${pacientes}" var="paciente">
                                                <option value="${paciente.id}"> <c:out value="${paciente.nome}"/></option>
                                            </c:forEach>
                                        </select>                                                                    
                                    </label>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5">
                                <div id="buscaMedico">
                                    <label for="inpBuscaMedico">Médico:
                                        <input id="inpBuscaMedico" type="text" name="buscaMedico" onblur="return validate(this,validStringAlpha,'medico');"/>
                                    </label>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="diaConsulta">Data: </label></td>
                            <td><input type="text" id="diaconsulta" name="diaconsulta" onblur="return validate(this,validData,'data');"/></td>
                            <td><label for="horaConsulta">Horário: </label></td>
                            <td><input type="text" id="horaConsulta" name="horaConsulta" onblur="return validate(this,validHora,'horario');"/></td>
                            <td>
                                <label for="tpConsulta">Tipo Consulta: </label>
                                <label for="tpConsNormal"><input type="radio" name="tpConsulta" id="tpConsNormal"/> Normal</label>
                                <label for="tpConsRetorno"><input type="radio" name="tpConsulta" id="tpConsRetorno"/> Retorno</label>
                            </td>
                        </tr> 
                        <tr>
                            <td colspan="5">
                                <input type="reset" value="Cancelar"/>
                                <input type="submit" value="Marcar"/>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </form>
        </div>
    </body>
</html>
